const tick = Date.now();
const log = (x) => console.log(`${x} \n Time:${Date.now() - tick}ms`);
const fruits = ["pineapple", "peach", "strawberry"];
const getFruit = async (name) => {
  const fruits = {
    pineapple: "🍍",
    peach: "🍑",
    strawberry: "🍓",
  };
  return Promise.resolve(fruits[name]);
};



const smoothie = fruits.map((v) => getFruit(v));
// console.log(smoothie)
// const smoothie1 = fruits.map(async (v) => {
//   const emoji = await getFruit(v);
//   log(emoji);
//   return emoji;
// });


// console.log(smoothie1)



// const fruitMap = async()=>{
//   for(const f of fruits){
//     const emoji =await getFruit(f);
//     log(emoji)
//   }
// }
// fruitMap()


// const fruitLoop = async()=>{
//   for await(const emoji of smoothie){
//     log(emoji)
//   }
// }

// fruitLoop()


const fruitInspection = async()=>{
  if(await getFruit("peach") ===  "🍑"){
    console.log("looks peachy")
  }
}

fruitInspection()